/*
 * @Author: taoshiwei
 * @Date: 2019-04-09 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:53:23
 *
 * 学科
 */

import request from '@/utils/request'

// 学科列表
// export const list = data => createAPI('/subjects', 'get', data)
export function list(params) {
  return request({
    url: '/subjects',
    params
  })
}
export function getSubjectsList(params) {
  return request({
    url: '/subjects',
    params
  })
}

// 学科简单列表
// export const simple = data => request('/subjects/simple', 'get', data)
export function simple(data) {
  return request({
    url: '/subjects/simple',
    data
  })
}

// 学科详情
// export const detail = data => request(`/subjects/${data.id}`, 'get', data)
export function detail(data) {
  return request({
    url: `/subjects/${data.id}`,
    data
  })
}

// 学科添加
// export const add = data => request('/subjects', 'post', data)
export function add(data) {
  return request({
    url: '/subjects',
    method: 'POST',
    data
  })
}
export function addSubject(data) {
  return request({
    url: '/subjects',
    method: 'POST',
    data
  })
}

// 学科修改
// export const update = data => request(`/subjects/${data.id}`, 'put', data)

export function update(data) {
  return request({
    url: `/subjects/${data.id}`,
    method: 'put',
    data
  })
}

// 学科删除
// export const remove = data => request(`/subjects/${data.id}`, 'delete', data)
export function remove(data) {
  return request({
    url: `/subjects/${data.id}`,
    method: 'delete',
    data
  })
}
